/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.system.action.system;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.system.mapper.system.FlowConfigMapper;
public class FlowConfig extends BaseAction
{
    @Autowired(required=false)
	private FlowConfigMapper mapper;
    /**
    工作流明细
    */
    
    public Map workFlowDet() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> steps=mapper.steps(params);
        result.put("steps", steps);
        
        return result;
    }
    /**
    修改流程
    */
    
    public Map workFlowSetUp() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> UserList=mapper.UserList(params);
        result.put("UserList", UserList);
        
        
        SQLList<SQLMap> stepSet=mapper.stepSet(params);
        result.put("stepSet", stepSet);
        
        
        result.put("steps", stepSet);
        
        return result;
    }
    /**
    工作流跳转
    */
    
    public Map workFlowJump1() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> skips=mapper.skips(params);
        result.put("skips", skips);
        
        return result;
    }
    /**
    工作流流程图
    */
    
    public Map workFlowChart1() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> chart_steps=mapper.chart_steps(params);
        result.put("chart_steps", chart_steps);
        
        
        result.put("steps", chart_steps);
        
        
        SQLList<SQLMap> skips=mapper.skips(params);
        result.put("skips", skips);
        
        return result;
    }
    /**
    工作流列表
    */
    
    public Map workFlowList1() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_flow=mapper.s_flow(params);
        result.put("s_flow", s_flow);
        
        return result;
    }
    /**
    设计流程步骤
    */
    
    public Map workFlowDesign() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> steps=mapper.steps(params);
        result.put("steps", steps);
        
        
        SQLList<SQLMap> s_next=mapper.s_next(params);
        result.put("s_next", s_next);
        
        return result;
    }
    /**
    选择工作流
    */
    
    public Map workFlowChoice() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        tb = createTreeBean("s_flow_treecols");
        SQLList<SQLMap> s_flow=mapper.s_flow(params);
        s_flow = s_flow.buildTree(tb,tb.getPid());
        result.put("s_flow", s_flow);
        
        
        params.def("CMCLASSID",null);
        SQLList<SQLMap> s_flow_list=mapper.s_flow_list(params);
        result.put("s_flow_list", s_flow_list);
        
        return result;
    }
    /**
    修改流程修改
    */
    
    public Map workFlowSetUpSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("action_step")){
            params=new SQLParam(request,emt.getMap());
            mapper.workFlowSetUpSubmit(params);
        }
        
        return result;
    }
    /**
    设计流程步骤修改
    */
    
    public Map workFlowDesignSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("action_step_skip")){
            params=new SQLParam(request,emt.getMap());
            mapper.i_action_step_skip(params);
        }
        
        return result;
    }
}